/**
 * @author 谭
 * 书后端参数验证
 */
"use strict";
const Joi = require('joi');

/*
    书分类标签验证
 */
exports.regAddBooksClassify = {
    body: {
        name: Joi.string().required()
    },
}


/*
    录入验证
 */
exports.regAddBooks = {
    body: {
        bookName: Joi.string().required(),
        author: Joi.string().required(),
        img: Joi.string().required(),
        classIfy: Joi.string().required(),
        number: Joi.number().required()
    },
}


/*
    获取验证
 */
exports.regGetBooks = {
    body: {
        pageNumber: Joi.number().required(), // 页码
        pageSize: Joi.string().required(), // 每页显示次数
    },
}

/*
    删除验证
 */
exports.regDelBooks = {
    params: {
        id: Joi.string().required()
    }
}


/*
    借阅书
 */
exports.regRecordBooks = {
    params: {
        recordId: Joi.number().required()
    }
}


